<?php
try{
    include '../ini.php';
    include '../classes/xl_languages.php';
    $dt_xl_languages=new xl_languages;
    $detail=$dt_xl_languages->read_content_table($_GET['table'],$_GET['id']);
    if($detail == NULL){
        throw new Exception('Không có dữ liệu mẫu');
    }
   	$dt_smarty->assign('detail',$detail);
	$contenForLayout=$dt_smarty->fetch('languages/translation_update.tpl');
	$dt_smarty->assign('contenForLayout',$contenForLayout);
	$dt_smarty->assign('titleForLayout','Sửa đổi ngôn ngữ');
	$dt_smarty->display('layout/defaults.tpl');
    $dbh=NULL;
}catch(Exception $e){
    $_SESSION['msg']=$e->getMessage();
    $_SESSION['type_msg']='error';
    if(empty($_SERVER['HTTP_REFERER'])){
        header('Location: translation_list.php');
    }else{
        header('Location:'.$_SERVER['HTTP_REFERER']);
    }
	$dbh=NULL;
}